Repository navigation
feat(agent): OpenCode detection + array-form MCP command audit - #109
Merged
Merged
Conversation
Two OpenCode-parity gaps from the surface audit: - detectAgentTargets() now recognizes an OpenCode project (opencode.json / opencode.jsonc / .opencode) and wires the managed kit block into AGENTS.md — the shared cross-tool rules file that both Codex and OpenCode read. Previously an OpenCode-only project (no .codex / AGENTS.md) wasn't detected. - auditMcpStdio() now handles OpenCode's array-form `command: ["node","-e","…"]` (bin + args in one array), not just the string form with a separate `args`. The malware-pattern and inline-eval checks apply to both shapes; benign array-form (`["npx", …]`) stays unflagged (noise control unchanged). Tests: OpenCode-only detection (opencode.json + .opencode); array-form inline code, array-form malware, benign array-form negative. Full suite 1540/0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
|
✅ Docker image built successfully
|
This was referenced Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes two OpenCode-parity gaps from the agent-surface audit. Both land directly on
main(independent of any stack).OpenCode detection (
detectAgentTargets) —AGENTS.mdis the shared cross-tool rules file that both Codex and OpenCode read. An OpenCode-only project (opencode.json/opencode.jsonc/.opencode, with no.codexorAGENTS.md) was previously not detected, so it never got the managed "use kit" block. It now wires the block intoAGENTS.md.Array-form MCP command (
auditMcpStdio) — OpenCode allowscommand: ["node", "-e", "…"](binary + args in one array), where Claude/Cursor use a stringcommand+ separateargs. The stdio audit previouslycontinued on a non-string command, so an inline-code/malware MCP server expressed array-style slipped through. It now handles both shapes; the malware-pattern and inline-eval checks apply to each, and benign array-form (["npx", …]) stays unflagged.Tests: OpenCode-only detection (
opencode.json+.opencode/); array-form inline-code, array-form malware (sh -c curl|sh), benign array-form negative. Full suite 1540/0.Remaining OpenCode item — a
memory/opencode.tstranscript parser — is separate: OpenCode stores per-message JSON under~/.local/share/opencode/storage/message/<sessionID>/, a different shape from the JSONL harnesses. Tracked for a follow-up once the message schema is verified.🤖 Generated with Claude Code
https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
Generated by Claude Code